1. Field of the Invention
The present invention relates to techniques for rewriting application programs while they are being mounted on/in a circuit board installed in an electronic control unit (ECU); these application programs are executable by a computer of the ECU. The electronic control unit will be abbreviated as ECU hereinafter.
2. Description of the Related Art
ECUs, which are preferably installed in an automobile and operative to control a target, such as an engine installed therein, have been well known, one example of which is disclosed in Japanese Unexamined Patent Publication No. H10-105468. In the ECU disclosed in the Publication, an application program for controlling a target(s) has been stored in a nonvolatile rewritable memory, such as a flash ROM (Reed Only Memory), EEPROM (Electrical Erasable Programmable Rom), or the like. The nonvolatile rewritable memory has been mounted, as a component of a computer, on/in a circuit board of the ECU. The computer of the ECU is operative to rewrite the application program in the nonvolatile rewritable memory without removing it from the circuit board of the ECU.
In such an ECU, when rewriting an earlier application program in a rewritable memory, first, an external device, such as a computer device, is prepared to be communicably connected to the ECU through a communication line. Next, a write request is sent from the external device to a computer of the ECU through the communication line as a command; this write request allows the computer to shift its operation mode into a mode (application program rewritable mode) in which the computer can rewrite application programs stored in the rewritable memory. Note that the write request can be transmitted from the external device to the ECU through a signal line different from the communication line.
After transmission of the write request, a rewrite control program is sent from the external device to the computer of the ECU; the rewrite control program is designed to cause a computer to:
receive a new application program sent from the external device; and
update the earlier application program to the received new application program.
Specifically, after sending of the rewrite control program, the new application program is sent from the external device to the computer of the ECU.
On the other hand, when receiving the write request, the computer of the ECU runs a boot loader (boot program) previously stored in the nonvolatile rewritable memory thereof. The boot loader causes the computer to:
receive the rewrite control program to download it in a RAM (Random Access Memory) of the computer; and
launch the rewrite control program stored in the RAM.
Specifically, as the launching process, the boot loader causes the execution location of the computer to jump to the leading address of the rewrite control program in the RAM. After jump of the computer's execution location, the computer executes the rewrite control program in the RAM to receive the new application program transferred from the external device, thereby updating the earlier application program to the received new application program in the rewritable memory.
These application-program rewriting operations set forth above are disclosed in the aforementioned Unexamined Patent Publication.
Specifically, these application-program rewriting operations allow the earlier application program to be rewritten into the new application program in the rewritable memory. For example, an earlier version of the application program can be updated to a new version thereof in the rewritable memory.
When no application programs to be updated has been stored in the rewritable memory, the new application program sent from the external device is stored in the rewritable memory.
In the Unexamined Patent Publication, the rewrite control program and the new application program have been stored in the external device as different files. The boot loader to be executed by the computer of the ECU serves as download of the rewrite control program into the RAM, and jump of the execution location of the computer to the leading address of the rewrite control program.
Such external devices for rewriting application programs in, for example, automobile field use any one of typically three different application-program sending ways (programs, procedures) A to C. A, B, and C types of external devices employ the application-program sending ways A, B and C, respectively.
Specifically, the A type of external devices is configured to have stored therein a rewrite control program and a new application program in different files.
The B type of external devices is configured to have stored therein a rewrite control program and a new application program in the same single file.
The C type of external devices is configured to have stored therein a new application program without storing a rewrite control program. This is because the C type of external devices is designed on the understanding that the rewrite control program has been stored in a nonvolatile memory of a computer of the ECU.
In order to rewrite an earlier application program stored in the ECU, in an external device of the A type, the rewrite control program and the new application program are separately sent from the external device of the A type to the ECU.
In contrast, in an external device of the B type, the rewrite control program and the new application program have been stored in the same single file, so that, in order to rewrite an earlier application program stored in the ECU, they are sent from the external device of the B type to the ECU in file. For this reason, the boot loader being executed by the computer of the ECU does not cause the computer to identify the end address of the rewrite control program. This results in that download of the rewrite control program into the RAM may come to nothing, making it difficult to accurately update the earlier application program.
In addition, because no rewrite control program is sent from an external device of the C type to the ECU, the boot loader being executed by the computer of the ECU may cause the computer to erroneously download the new application program sent from the external device of the C type into the RAM as the rewrite control program. This may also make it difficult to accurately update the earlier application program.
It may be considered that boot loaders (boot programs) are designed exclusively for the types A, B, and C of external devices. This may cause the number of processes for developing the dedicated boot loaders for the types A to C of external devices to increase. In addition, it may be necessary to select one of the boot loaders to match any one of the types of an external device used, causing management of the dedicated boot loaders and the external devices of the types A to C to become complicated.
If one of the boot loaders, which does not match the type of an external device used, is installed in the computer of the ECU, earlier application programs, which have been already installed in the computer of the ECU, cannot be updated to new ones.